<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="../../../common/meta.jsp"%>
		<script type="text/javascript"
			src="../../../script/jquery.ui.draggable.js">
</script>
		<script type="text/javascript">
function opendialog(obj1) {
	var dialog = art.dialog( {
		id : obj1,
		title : '孤儿单明细'
	});
	$
			.ajax( {
				url : '${path}/business/polunc/index/unclaimedpolicydetail?agentid=' + obj1,
				success : function(data) {
					dialog.content(data);
				},
				cache : false
			});
}
</script>
		<script type="text/javascript">
$(document).ready(function() {
	var addSelOption = function(jq) //方法addSelOption : 为匹配对象添加一项"请选择"， jq ： jQuery对象   
	{
		//创建option对象，并设置文本为"请选择"，value值为-1   
		var opt = $("<option/>").text("请选择").attr("value", "-1");
		//将option对象添加到select中   
		jq.append(opt);
	}
	//添加span节点并添加loadding的gif图片   
		/*var loadImg = function(br) {
			$("#loaddingImg").find("img").remove();
			var oSpan = ""; // $("<span id='loaddingImg'><img src='../../../images/loading.gif' /></span>");   
			br.after(oSpan);
		}*/
		/*var requestUrl = "${path}/common/index/getbranch";
		$.ajax( {
			type : "post",
			//默认为get   
			dataType : "json",
			url : requestUrl,
			success : function(json) {
				$(json).each(
						function() {
							var opt = $("<option/>").text(this.branchName)
									.attr("value", this.branchId);
							if (this.branchId == "${bid}"
									&& this.branchId != "") {
								opt.attr("selected", "selected");
							}
							$("#bid").append(opt);
						});
				$("#bid").change();
			}
		});*/
		//第一个下拉框
		/*$("#bid").change(
				function() {
					var branchId = $(this).val();
					if (branchId != "-1") {
						var requestUrl = "${path}/common/index/getcbranch";
						$.ajax( {
							dataType : "json",
							url : requestUrl,
							//传入的参数   
							data : "branchID=" + branchId,
							//发送请求前加载loadding的gif图片   
							beforeSend : loadImg($("#bid")),
							success : function(json) {
								//删除gif图片的span节点   
								$("#loaddingImg").remove();
								$("#cbid").empty();
								addSelOption($("#cbid"));
								$(json).each(
										function() {
											var opt = $("<option/>").text(
													this.branchName).attr(
													"value", this.branchId);
											if (this.branchId == "${cbid}"
													&& this.branchId != "") {
												opt
														.attr("selected",
																"selected");
											}
											$("#cbid").append(opt);
										});
								$("#cbid").change();
							}
						});
					} else {
						$("#cbid").empty();
						addSelOption($("#cbid"));
						$("#ubid").empty();
						addSelOption($("#ubid"));
					}
				});*/

		//第二个下拉框
		/*$("#cbid").change(
				function() {
					var branchId = $(this).val();
					if (branchId != "-1") {
						var requestUrl = "${path}/common/index/getubranch";
						$.ajax( {
							dataType : "json",
							url : requestUrl,
							data : "branchID=" + branchId,
							beforeSend : loadImg($("#cbid")),
							success : function(json) {
								$("#loaddingImg").remove();
								$("#ubid").empty();
								addSelOption($("#ubid"));
								$(json).each(
										function() {
											var opt = $("<option/>").text(
													this.branchName).attr(
													"value", this.branchId);
											if (this.branchId == "${ubid}"
													&& this.branchId != "") {
												opt
														.attr("selected",
																"selected");
											}
											$("#ubid").append(opt);
										});
							}
						});
					} else {
						$("#ubid").empty();
						addSelOption($("#ubid"));
					}
				});*/
	});

$(function() {
	fixTable.FixTable("mytable");
	$("#fullScreen").click(function() {
		fullScreen.FullScreen("mylist");
	});
})

function doQuery() {
	document.form1.action = "${path}/business/polunc/index/doQuery";
	document.form1.submit();
}
</script>
	</head>
	<body id="master">
		<sfa:mainHeader></sfa:mainHeader>
		<form action="" name="form1" method="post">
			<div class="webpart3 contentarea">
				<div class="webpart-head">
					<div class="webpart-head-item">
						孤儿单查询
						<div class="tools-btn">
							<a href="#" id="fullScreen"><span> <img
										src="${path}/statics/images/qp.gif"
										style="margin-right: 4px; margin-bottom: -3px;" />全屏</span> </a>
						</div>
					</div>
				</div>
				<div class="webpart-main">
					<div class="webpart-main-item" style="padding-top: 12px;">
						<div class="search">
							<table width="100%" border="0" cellspacing="0" cellpadding="10"
								class="table_form">
								<!--<tr>
									<td align="right">
										分公司：
									</td>
									<td align="left">
										<select id="bid" name="bid" disabled="disabled">
											<option value="-1">
												请选择
											</option>
										</select>
									</td>
									<td align="right">
										督导区：
									</td>
									<td align="left">
										<select id="cbid" name="cbid">
											<option value="-1">
												请选择
											</option>
										</select>
									</td>
									<td align="right">
										营业部：
									</td>
									<td align="left">
										<select id="ubid" name="ubid">
											<option value="-1">
												请选择
											</option>
										</select>
									</td>

								</tr>
								--><tr>
									
									<td align="right">
											投保单号：
										</td>
										<td>
											<input name="appno" type="text" size="17" value="${appno }" />
										</td>
										<td align="right">
											保单号：
										</td>
										<td>
											<input name="conno" type="text" size="17" value="${conno}" />
										</td>
									
									
									<td align="right">
										<input name="Input" type="button" class="linkbtn2" value="查  询"
											onclick="doQuery()" /> 
										<input name="Input" type="button" class="linkbtn2" value="返  回"
											onclick="javascript: history.back();" /> 
									
									</td>
								</tr>
								<tr>
									<td align="right">
											投保人姓名：
										</td>
										<td>
											<input name="cname" type="text" value="${cname }" size="17" />
										</td>
									<td align="right">
										<font color="red">*</font>解约日期：
									</td>
									<td align="left" colspan="4">
										<input name="sdate" id="sdate" style="width: 80px;"
											type="text" value="${sdate}"
											onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
										&nbsp;~&nbsp;
										<input name="edate" id="edate" style="width: 80px;"
											type="text" value="${edate}"
											onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
									</td>
								</tr>
							</table>
						</div>
						<!-- 查詢列表 -->
						<div id="mylist" style="height: 365px;" class="dlist">
							<table id="mytable" cellpadding="0" cellspacing="0"
								class="dg_borderstyle  trStyleTable"
								style="margin-top: 0px; text-align: center;">
								<tr>
									<th name="fixcol"><span>序号</span></th>
									<th style="min-width: 100px;">
										<span>省机构&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th style="min-width: 100px;">
										<span>市机构&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th style="min-width: 100px;">
										<span>营业部&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th>
										<span>解约人代码&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th>
										<span>解约人姓名&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th style="min-width: 80px;">
										<span>推荐人&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th>
										<span>管理人&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th width="150px">
										<span>归属人代码&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th>
										<span>归属人名称&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th>
										<span>归属人职级&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th width="200px">
										<span>保单号&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th width="150px">
										<span>投保单号&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th>
										<span>规模保费&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th style="min-width: 50px;">
										<span>缴别&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th style="min-width: 50px;">
										<span>年期&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th>
										<span>保单年度&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th style="min-width: 80px;">
										<span>投保人&nbsp;&nbsp;&nbsp;</span>
									</th>
									<th>
										<span>被保险人&nbsp;&nbsp;&nbsp;</span>
									</th>
								</tr>
								<c:forEach items="${pagination.resultList}" var="list" varStatus="ind">
									<tr>
										<td>${(pagination.page-1)*10+(ind.index+1)}</td>
										<td>
											<span>${list.BRANCHNAME}</span>
										</td>
										<td>
											<span>${list.CBRANCHNAME}</span>
										</td>
										<td>
											<span>${list.UBRANCHNAME}</span>
										</td>
										<td>
											<span><a href="#"
												onclick="opendialog('${list.AGENTID}')">${list.AGENTCODE}</a>
											</span>
										</td>
										<td>
											<span>${list.AGENTNAME}</span>
										</td>
										<td>
											<span>${list.RECOMMENDAGENTNAME }</span>
										</td>
										<td>
											<span>${list.MANAGERAGENTNAME }</span>
										</td>
										<td>
											<span>${list.ASCRIPTIONAGENTCODE }</span>
										</td>
										<td>
											<span>${list.ASCRIPTIONAGENTNAME }</span>
										</td>
										<td>
											<span>${list.AGENTLEVELNAME }</span>
										</td>
										<td>
											<span>${list.CONTRACTNO }</span>
										</td>
										<td>
											<span>${list.APPLICATIONNO }</span>
										</td>
										<td>
											<span>${list.MODALVALUE }</span>
										</td>
										<td>
											<span>${list.PREMIUMMODE }</span>
										</td>
										<td>
											<span>${list.PREMIUMPERIOD }</span>
										</td>
										<td>
											<span>${list.POLICYYEAR }</span>
										</td>
										<td>
											<span>${list.APPLICANTNAME }</span>
										</td>
										<td>
											<span>${list.INSUREDNAME }</span>
										</td>
									</tr>
								</c:forEach>

							</table>
						</div>
						<!----------- 翻页导航 ------------------>
						<c:if test="${not empty pagination.multiPage}">
							<div class="dg_pagerstyle">
								<div class="pageinfo">
									第${pagination.page }页 | 共${pagination.totalPages
									}页/${pagination.totalRows }条记录
								</div>
								<div class="pagebtn">
									${pagination.multiPage}&nbsp;
								</div>
							</div>
						</c:if>
					</div>
				</div>
				<div class="webpart-foot">
					<div class="webpart-foot-item">
					</div>
				</div>
			</div>
		</form>
		<sfa:mainFooter></sfa:mainFooter>
	</body>
</html>